(:
  A procedure to number all items in a Display file
  It suppresses any previous numbering
:)
declare boundary-space strip;
import module namespace
    jj = "http://kumquat.emse.fr/utilitaires"
    at "jjutils.xq" ;
let $t := doc($arguments[1])/display
let $titles := fn:distinct-values($t/item/info/@name)
return
<html>
<body><table>{
<tr>{
for $title in $titles where fn:not($title = ("src-anchor","begin","end"))
return
<td>{$title}</td>
}</tr>,
let $d := $t/item
for $item at $p in $d
return
  <tr>{
       for $title in $titles where fn:not($title = ("src-anchor","begin","end"))
       return
         <td>{if ($title="time") then jj:dateFromDREW($item/info[@name=$title]/time/date)
         else xs:string($item/info[@name=$title])}</td>
  }</tr>
}</table></body></html>
